UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b7B0UyRJRaCYUKQdQShd9OM0zLa6L2cpjrXftiJRAAY='
WHERE
key_id = '447e285810113966c4a384cea0d0784c331bcde63fc0108e04eadf02dcd75d8d'
AND (
token = 'b7B0UyRJRaCYUKQdQShd9OM0zLa6L2cpjrXftiJRAAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)