UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vHWdWn7YPauJE8FMiHb2uooib0tdQwM1p2CRSFJknVI='
WHERE
key_id = '65923fb0114bf7033a2b756c4248746c8dd155a8d2f9595f18a8de80a80d9f5a'
AND (
token = 'vHWdWn7YPauJE8FMiHb2uooib0tdQwM1p2CRSFJknVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)