UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhxh7eVTuiVQFY3IWBSsoxZc0jy3sOk/2PjBcZLHKjY=' 
WHERE 
  key_id = '95742dfd41ae2ee8ca95d0ce5c549b83550e8dcaa87c4d5563f579cf9dbdd9a9' 
  AND (
    token = 'zhxh7eVTuiVQFY3IWBSsoxZc0jy3sOk/2PjBcZLHKjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028