UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JRJdOUNlcGgqzuzecl6hTWE0WZd9zczfiGTu8yAz57A=' 
WHERE 
  key_id = '41aa11c8bfaf46194cb4356cfc9d7a23ce6101458693c7f5771bf4d522337d57' 
  AND (
    token = 'JRJdOUNlcGgqzuzecl6hTWE0WZd9zczfiGTu8yAz57A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017