UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ZoLf1aUt+kqQEKUqlIVGPbP/1H1urCQrVuWkf2hupo='
WHERE
key_id = '7b71bbf18401b4de54d374a6b680fcd7be006a6eb14b4a4c7592e1830d836da8'
AND (
token = '2ZoLf1aUt+kqQEKUqlIVGPbP/1H1urCQrVuWkf2hupo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)