UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9YlBAEO6Z/XjJXQPCVtTnoeWgNicD2LZGUl1JQ+dAwM='
WHERE
key_id = '593e07fa3e2508359a203b46b946e87fcf6e348266875d9db9d8b953fbd31c07'
AND (
token = '9YlBAEO6Z/XjJXQPCVtTnoeWgNicD2LZGUl1JQ+dAwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)