UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ilkewx9nafZw3QMov9gGKZvD0kZSQJd5R1eDDfiYJw8=' 
WHERE 
  key_id = '3a6a7767122c9298a7f775c6f79e1fece564c554bb3b07e1d6aa025f557319e3' 
  AND (
    token = 'ilkewx9nafZw3QMov9gGKZvD0kZSQJd5R1eDDfiYJw8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057