UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EnjKLugl/ahwsHKrQqIWm/4G84VJHvK68YniqrNh7Vc=' 
WHERE 
  key_id = '3ee688f4ce5e7f11a5f1e518470b56f2bb512c20727635073c5753cda8c135a1' 
  AND (
    token = 'EnjKLugl/ahwsHKrQqIWm/4G84VJHvK68YniqrNh7Vc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046