UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zByqhnnLAPXi+YLzUbtaqmuqgGaTkYYC27qD0HK7UU='
WHERE
key_id = '81860b5e83090c3375a939836d3e664c4417ca2ca13e8807787e225aa6e26081'
AND (
token = '4zByqhnnLAPXi+YLzUbtaqmuqgGaTkYYC27qD0HK7UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)