UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ZQaM/JUgJ7qS8yieYRhdcxdTxVexU1pnF9aPDPug3U=' 
WHERE 
  key_id = '216fa7244e04f510381683e88560a49d69e921a5a47437ed4dbfd71b0e2f0b1d' 
  AND (
    token = '0ZQaM/JUgJ7qS8yieYRhdcxdTxVexU1pnF9aPDPug3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025