UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5GjUXz1Jnz+RJyZh+zl3gHDDGqbYUgCvL5UQRrpY6tQ='
WHERE
key_id = 'b186af741be203f35eb7900cc129e295e5a6927ea9cced0c04a0cf51a407688e'
AND (
token = '5GjUXz1Jnz+RJyZh+zl3gHDDGqbYUgCvL5UQRrpY6tQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)