UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'owTkCmcBDRrccMRuvwqfa71LGMBi8FxI98o1pRR4RcU=' 
WHERE 
  key_id = '33222954665d2bb21a9bc3c6fec3fe636f6a41b1d66e091f1e4b4d7969b7d749' 
  AND (
    token = 'owTkCmcBDRrccMRuvwqfa71LGMBi8FxI98o1pRR4RcU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019