UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jnAHcnEruN0H31af0FxpUwtrB/wguvCBT56aeFe/lFo='
WHERE
key_id = '40008f85471462a9e6821d49015e2d0d6aabde59f564b1b8f8a30a46e8f1219d'
AND (
token = 'jnAHcnEruN0H31af0FxpUwtrB/wguvCBT56aeFe/lFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)