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