UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6e/xYWneh97jGmBc1TNOXn8OmK+qJYw/qPLVGRus9Lc='
WHERE
key_id = '5ed3bc48dc18b7beafad7dbf62de97506723a09de9f0d5db8ce337043f89622b'
AND (
token = '6e/xYWneh97jGmBc1TNOXn8OmK+qJYw/qPLVGRus9Lc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)