UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QYG4dwOp3F371NVxpeqKJgX67WfIBqJm9KfgHdnDUvI='
WHERE
key_id = '437e5b8aeb8baeb3ba0e94dafd674ad53da6e43e2fea397181d49f165f54287c'
AND (
token = 'QYG4dwOp3F371NVxpeqKJgX67WfIBqJm9KfgHdnDUvI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)