UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yvwlFgDCT1SwzrjLySay9xC8Mdewy3ZTA7lecARjSrA=' 
WHERE 
  key_id = '6fa912bf2411d71f5c9bb1afa003d7f39aa17aa89a3a1674f66bb39dd116d7e5' 
  AND (
    token = 'yvwlFgDCT1SwzrjLySay9xC8Mdewy3ZTA7lecARjSrA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022