UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KO2zLOgc05lx7gkoIJiWsKGh2MYvM48Gh2Spa7rTddE='
WHERE
key_id = '91efff903e488b2190e7ccf8f31c3fcbd8d0f846843ed1ee3fb3534ffc3627ad'
AND (
token = 'KO2zLOgc05lx7gkoIJiWsKGh2MYvM48Gh2Spa7rTddE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)