UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9v/hoZIHvhbJpOufhUmUjGVKOzKcPBnDvULM3PH707w='
WHERE
key_id = '1b180397635e1912e2dffb16944a0622a43fdeebc8e99666748a124a43670702'
AND (
token = '9v/hoZIHvhbJpOufhUmUjGVKOzKcPBnDvULM3PH707w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)