UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LCAlookL6SojjSJZMtJe7GRhEN2xDGkDAS/xY8tHbEo='
WHERE
key_id = '2a6018fda4a301499e631b6941e5c8374188d5f75c5dc65675c01169a37a4618'
AND (
token = 'LCAlookL6SojjSJZMtJe7GRhEN2xDGkDAS/xY8tHbEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)