UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GZ7snFuGQ1d9lorXm7L9G7gVbkz7HkpXKpWWp5SNrig='
WHERE
key_id = 'a59c253e015cbb9efacfa7ae07dfeb052a239cdfeb36e5d56d234c8c07c06565'
AND (
token = 'GZ7snFuGQ1d9lorXm7L9G7gVbkz7HkpXKpWWp5SNrig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)