UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UdP/GEmPLeq92DP6L388bS7DUkXy9+0Y1DdiYo6eJgI='
WHERE
key_id = '09a683ceb20a9a448527f93f500c36ee048767e9e2137a8c7f327b89c2c08f16'
AND (
token = 'UdP/GEmPLeq92DP6L388bS7DUkXy9+0Y1DdiYo6eJgI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)