UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EN0OkQJQeH5XnTbp2UO1AMZ/6hRTASq9XUlHcTqy2Uc='
WHERE
key_id = 'ef7f10c582b7ea12e14dd4e9b97016efb18287d284951d91b610a68531ab961e'
AND (
token = 'EN0OkQJQeH5XnTbp2UO1AMZ/6hRTASq9XUlHcTqy2Uc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)