UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QidO8c2bfUbWxzRENtcxveByeyqlcYbGMy06toNvECo=' 
WHERE 
  key_id = '26bb67ce129036d85fcdd1e5979b5809ed156d36cb7943f8b96ab7352ebdd713' 
  AND (
    token = 'QidO8c2bfUbWxzRENtcxveByeyqlcYbGMy06toNvECo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028