UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '22zzPr7Hc2v9vvfLj/QPeCgijKqRHfKgoRene2orhsI='
WHERE
key_id = '0806fb7b816f00a6ac63f61df541176f3e0c4cbed5e95183918fb54adaa06994'
AND (
token = '22zzPr7Hc2v9vvfLj/QPeCgijKqRHfKgoRene2orhsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)