UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cfFZKNOandV6S5k+JXoIiHouLjX3ye4Q7eNsrCiK73o=' 
WHERE 
  key_id = 'b369f97fac22202565e543de6d159660d89cc0f056dc9ded1d799e605b657293' 
  AND (
    token = 'cfFZKNOandV6S5k+JXoIiHouLjX3ye4Q7eNsrCiK73o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039