UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1VqFiUSZXv/eU4qp5XfaHHGueLHlntJB2yjM+vu9YDI=' 
WHERE 
  key_id = 'e85f9ad87c956c6e9616bdb0fc18c7904e56b938f31d11334c66f08b3aae550d' 
  AND (
    token = '1VqFiUSZXv/eU4qp5XfaHHGueLHlntJB2yjM+vu9YDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025