UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b8feY0fBSJKr5aTF37ILM/eLzVqQYIKNc0vSeHlo0UA='
WHERE
key_id = 'c55d74d407b7296aac0c74ea9ac5838cd7bb87e04f054ec76d3f88d48c2c9a1d'
AND (
token = 'b8feY0fBSJKr5aTF37ILM/eLzVqQYIKNc0vSeHlo0UA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)