UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CL6Xlgth0zLIVNWPhLjveXM1cTNl5WWmG0/8aaGXUho=' 
WHERE 
  key_id = 'a0ed18e9072532bc96a5d02e3a1c554613cc11c82f1d1a8bac6301fd6c8a6791' 
  AND (
    token = 'CL6Xlgth0zLIVNWPhLjveXM1cTNl5WWmG0/8aaGXUho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043