UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hmGyoxrEnP7QL/0u3fZtXjgje/BkiVxl+LUs7H8fids=' 
WHERE 
  key_id = '6cca1c6fb2881ed6f46bcd97d5dae24db6f71409737cdb40f180bd3189cf268f' 
  AND (
    token = 'hmGyoxrEnP7QL/0u3fZtXjgje/BkiVxl+LUs7H8fids=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030