UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+0F+kRlDP2zCqqy9o8YpeV5IJT3Z2DrkmMUH/XLcr5w='
WHERE
key_id = 'ba3edac713f904b622e22a8eb36e62111a8f66e71702f74906e382d73ea4469f'
AND (
token = '+0F+kRlDP2zCqqy9o8YpeV5IJT3Z2DrkmMUH/XLcr5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)