UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmpI/rIhB6d6UXPJur6TEFXgH5MAa0l6T4jI4vwxkUg='
WHERE
key_id = '4d818b39aa21fb5e798001ad2704d4bd2bd4343c127f0218a3a20769aef69c31'
AND (
token = 'qmpI/rIhB6d6UXPJur6TEFXgH5MAa0l6T4jI4vwxkUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)