UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D7RBW+bUS7/o9vwDuZsamShGJIDM/MHXUkI7cA2D+3U='
WHERE
key_id = '6b55af8e8efd9289e4f693c0eee384975cb9a15568f43d9d13e6ab29883a4323'
AND (
token = 'D7RBW+bUS7/o9vwDuZsamShGJIDM/MHXUkI7cA2D+3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)