UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FJYB90YgFtSUkR3p2PIpKtpWElFrLsDHZjcNhjR/TDA=' 
WHERE 
  key_id = 'f546f09a4758b44b90b481f90328291764dd74fd5f84afae130ba00e3a7baad4' 
  AND (
    token = 'FJYB90YgFtSUkR3p2PIpKtpWElFrLsDHZjcNhjR/TDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049