UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T7i2xDxQeCIBKsH2C2svDuVprJ/y8GKB02q0AFCuJio=' 
WHERE 
  key_id = '90112422289b80e3c33f47f2c47d0e1c9a65aa52f404116e0eb2c16a14aaf3d9' 
  AND (
    token = 'T7i2xDxQeCIBKsH2C2svDuVprJ/y8GKB02q0AFCuJio=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047