UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZPlxBCgVGMdPBDBluEFyXoC30KAwg8B3lN9MAiiDW4I='
WHERE
key_id = '6fd7b6448c5b2761204005b7ff5503f443e35179e7014354d5252a2b64cf30d9'
AND (
token = 'ZPlxBCgVGMdPBDBluEFyXoC30KAwg8B3lN9MAiiDW4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)