UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8c6WOS4wqJNXHi6l9DwuRwfim6zn8FNHHejYusVcuZs=' 
WHERE 
  key_id = '67cbc5089a38c715f60f6362172b69e5393c58cc9b77e3e12ff2bd5f5e0bc2c2' 
  AND (
    token = '8c6WOS4wqJNXHi6l9DwuRwfim6zn8FNHHejYusVcuZs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022