UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nPlThH3W9e4zA29u75dp1IW72hmmJAIBv678/eVsgTg=' 
WHERE 
  key_id = '066ec0b2ca3ce597a26ab5086362c472116d99eec6b018d36b5cb5ffd582f0bb' 
  AND (
    token = 'nPlThH3W9e4zA29u75dp1IW72hmmJAIBv678/eVsgTg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00011