UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8HCshzNFaxek0LzRuyLi3hZnWBwNFLxlHIErTLxeAkI='
WHERE
key_id = '1fde275c52f5c8aa8ed2d40ce95c04d3301c14580a9cbf52eabb298d2ec1b893'
AND (
token = '8HCshzNFaxek0LzRuyLi3hZnWBwNFLxlHIErTLxeAkI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)