UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6NCIgZMAK7rQGXwB/7XN+pJm5Yq7xAt7gSdmJBY9S+A='
WHERE
key_id = '5f85aa14515d4055bf291dc084e0eebc7bc39289ef0f8fe4eb5224844af6c4e0'
AND (
token = '6NCIgZMAK7rQGXwB/7XN+pJm5Yq7xAt7gSdmJBY9S+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)