UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PsroGl1Pu72P1K3m9bahyajhJ1D7FrwZ76mkDhsCSo8='
WHERE
key_id = '05b99e8e563600674bc2d39cb35f20e01667465b1c09c6aa961c789121da9fce'
AND (
token = 'PsroGl1Pu72P1K3m9bahyajhJ1D7FrwZ76mkDhsCSo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)