UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XZLa5jBHLbOEZttvhW2HvYGZ213gjcZX9/hYnI2QMlA='
WHERE
key_id = 'fa26f8e7e41eb5b2136a22036f2be645eeee5040d281db7564f0882c8a6349e7'
AND (
token = 'XZLa5jBHLbOEZttvhW2HvYGZ213gjcZX9/hYnI2QMlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)