UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zusUr83agRosf7mP3JnNYZcJU7nNuxIsWagcYs4ddh8='
WHERE
key_id = '0d23c08f8011b98e22122248437ce5b05cd9a629e4e0ef12cf748d032abda744'
AND (
token = 'zusUr83agRosf7mP3JnNYZcJU7nNuxIsWagcYs4ddh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)