UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pGoCSzYwuerr7YiVU/R+FBDYIFZyvMSOLgsEoPTicdk='
WHERE
key_id = '63dcf948dd797e19744294ac82ed6ad7bd3bd625853387dc171c4de7904e15b8'
AND (
token = 'pGoCSzYwuerr7YiVU/R+FBDYIFZyvMSOLgsEoPTicdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)