UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ci89a42KFjqvRWwU2QW+xryJCxLuo8NB7L0iVqkGoIk='
WHERE
key_id = '9e96e4d3142287923c72f6601bd70893f5f53a1896d5b355317423a38ea8c1e9'
AND (
token = 'Ci89a42KFjqvRWwU2QW+xryJCxLuo8NB7L0iVqkGoIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)