UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S/i/dMLU8lY8ycxxj/ONl9ES/SyFglhssKaizw71bq0=' 
WHERE 
  key_id = '0d38345fcaaa47ef17650f1f9dbe32253c4f9d9c17105d37962f270a8af0bb58' 
  AND (
    token = 'S/i/dMLU8lY8ycxxj/ONl9ES/SyFglhssKaizw71bq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027