UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q1tkbjwFbV6f3iOmc6L7bkjg9BHHH/uXba6mwADUCsU='
WHERE
key_id = '69006089a0fba3d5e65340b46967a42ce69e41e1f65fe10afc452cbec4e51df8'
AND (
token = 'q1tkbjwFbV6f3iOmc6L7bkjg9BHHH/uXba6mwADUCsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)