UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '39MWCEN/xXQE6vcYChYHZuM5qQUzhOlFHaf7JpL9sxQ=' 
WHERE 
  key_id = '646b2c829733b178d11c201aebe4dc9c58af93604a6a455f1cb8b4cf67fa3b4b' 
  AND (
    token = '39MWCEN/xXQE6vcYChYHZuM5qQUzhOlFHaf7JpL9sxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022