UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hV2AERwEzXEUS+reTvEFB/m0ln4GaKjIi/6QYsPDIi0='
WHERE
key_id = 'fd7a51d3057c79115d3c5f56c00933590e07757d848aa6bf876b07bf25b9d06a'
AND (
token = 'hV2AERwEzXEUS+reTvEFB/m0ln4GaKjIi/6QYsPDIi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)