UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1VayB9SbbDaffjzUt+twddbz4pZBuDPmp9xINw2Ifso=' 
WHERE 
  key_id = '636146a596584f7e44fca73ab620256284d5005054d5a816a54c1c5494c9f50b' 
  AND (
    token = '1VayB9SbbDaffjzUt+twddbz4pZBuDPmp9xINw2Ifso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039