UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sqfAxzzNXLJuTHtNdUx3gb7SDhhZ2g2pU4ooxvLURCs=' 
WHERE 
  key_id = '2aea3726b7b47b33cf292f3c4f01edbcf995db0d0e806d129909ff3d6c3c409b' 
  AND (
    token = 'sqfAxzzNXLJuTHtNdUx3gb7SDhhZ2g2pU4ooxvLURCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058