UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4tbNFLoZFiTJtCRCQN3OhP8EuNNqqTMeZWbWl9c2SiM=' 
WHERE 
  key_id = '2b40e5b61914fb68acb03a251d30d8fb8e727233514f6ec4c51d22aa1e5f1c8b' 
  AND (
    token = '4tbNFLoZFiTJtCRCQN3OhP8EuNNqqTMeZWbWl9c2SiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031