UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8/Kf4DaXn6+R3N3Ta3RGEDbEt450c/70RmrnR/XMEzo='
WHERE
key_id = '347a662f0bb18f1901a2db900a7b74756106f135c814f8b0f39849ab83ded7b5'
AND (
token = '8/Kf4DaXn6+R3N3Ta3RGEDbEt450c/70RmrnR/XMEzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)