UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7WATEzGjDHbigpBFoQSD8pNMf59ZFP6SEQZRRaAsV00=' 
WHERE 
  key_id = '6b345007748a995f235584039752143b5fcee59c4aaf35661ad2d8b8fff874d8' 
  AND (
    token = '7WATEzGjDHbigpBFoQSD8pNMf59ZFP6SEQZRRaAsV00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032