UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YhakxIAQf2UQkHLWagi1Rz6bb0yU+gKwTc/6dCKlS1w=' 
WHERE 
  key_id = '4142d46081ff2dd8c2b3533ea9cc8d8fd6a7555b1b74267fd40e0d00498ff231' 
  AND (
    token = 'YhakxIAQf2UQkHLWagi1Rz6bb0yU+gKwTc/6dCKlS1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029