UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5rEroLdDvBQsW8NRfyE69uNL6JIjLtrTyVsEiSgm/a4='
WHERE
key_id = 'a6d364c2d91b9c50eaa530f2ee1f4cf1ccd900e167ea692f4a5cbfa2794a96fc'
AND (
token = '5rEroLdDvBQsW8NRfyE69uNL6JIjLtrTyVsEiSgm/a4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)