UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SEZ+bcUGlq4ltbqWMXPe1WQOdJuDP5rSHdKuaiQ1oC4='
WHERE
key_id = '8bb77b05cfede4fca83ad88658c3aa8ecb6a35cbad8d11d53341babec7713a50'
AND (
token = 'SEZ+bcUGlq4ltbqWMXPe1WQOdJuDP5rSHdKuaiQ1oC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)