UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VNGbl6qCNffUKrxxGYcelueEnILXw9YU9DN9xdCFdyE='
WHERE
key_id = '6e96c837d13091c3f841055c9725e0a11e8008cf2dca7ce1be8df5f862edf1c0'
AND (
token = 'VNGbl6qCNffUKrxxGYcelueEnILXw9YU9DN9xdCFdyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)