UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DxNpPRUw2GII/vIJp0/yYDrF1z762mFMCd2EurJXd1M='
WHERE
key_id = 'bfbdf3b93400482b3432d871b797d26d75dad837370f9572b607829d9aad2261'
AND (
token = 'DxNpPRUw2GII/vIJp0/yYDrF1z762mFMCd2EurJXd1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)