UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ulS7kQ4WdztmQmrhMqaZg/HS8TrP3plV5Ow1s1jFDAc=' 
WHERE 
  key_id = 'c3c1959ac3d36415114d407d9e857f6a020e9035a7f1758d6ce51b88f5028dac' 
  AND (
    token = 'ulS7kQ4WdztmQmrhMqaZg/HS8TrP3plV5Ow1s1jFDAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030